//
//  NSArray+YKOCExection.h
//  YKOCExection
//
//  Created by edward on 2020/6/11.
//  Copyright © 2020 edward. All rights reserved.
//


#import <Foundation/Foundation.h>

@interface NSArray (YKOCExection)


/// 数组元素转换
typedef id _Nonnull (^YKItemMap)(id _Nonnull item);
typedef NSArray *_Nonnull(^YKArrayMap)(YKItemMap _Nonnull itemMap);

/// 数组元素筛选
typedef BOOL(^YKItemFilter)(BOOL stay);
typedef NSArray *_Nullable(^YKArrayFilter)(YKItemFilter _Nullable itemFilter);


/**
 取出模型数组中某个属性组成数组
 @param propertyName 要取出的属性名
 @return 属性值组成的数组
 */
- (NSArray *_Nullable)yk_fetchPropertys:(NSString *_Nullable)propertyName defaultValue:(id _Nullable )value;

- (NSArray *)yk_fetchPropertys:(NSString *)propertyName otherProperty:(NSString *)otherProperty defaultValue:(id)defaultValue;

- (NSString *)yk_arrayJson;

- (NSMutableArray *)deepMutableCopy NS_RETURNS_RETAINED;



//数组元素映射
@property (nonatomic, copy, readonly) YKArrayMap map;

//数组元素过滤
@property (nonatomic, copy, readonly) YKArrayFilter filter;

@end
